//
//  MZY_IntroduceCell.m
//  FullHouse
//
//  Created by dllo on 16/1/15.
//  Copyright © 2016年 yy. All rights reserved.
//

#import "MZY_IntroduceCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
#define HORIZONTAL [UIScreen mainScreen].bounds.size.width / 414
#define VERTICAL [UIScreen mainScreen].bounds.size.height / 736

@implementation MZY_IntroduceCell

- (void)dealloc
{
    [self.screenView release];
    [self.bottomView release];
    [self.picImageView release];
    [self.headImageView release];
    [self.titleLabel release];
    [self.introduceLabel release];
    [self.likeButton release];
    [self.likeCountLabel release];
    [self.priceLabel release];
    [super dealloc];
}

// 自定义初始化方法
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    self.screenView = [[UIView alloc]init];
    self.screenView.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.screenView];
    [self.screenView release];
    
    self.bottomView = [[UIView alloc]init];
    self.bottomView.backgroundColor = [UIColor whiteColor];
    [self.screenView addSubview:self.bottomView];
    [self.bottomView release];
    
    self.picImageView = [[UIImageView alloc]init];
    [self.screenView addSubview:self.picImageView];
    [self.picImageView release];
    
    self.headImageView = [[UIImageView alloc]init];
    [self.screenView addSubview:self.headImageView];
    [self.headImageView release];
    
    self.titleLabel = [[UILabel alloc]init];
    [self.screenView addSubview:self.titleLabel];
    [self.titleLabel release];
    
    self.introduceLabel = [[UILabel alloc]init];
    [self.screenView addSubview:self.introduceLabel];
    [self.introduceLabel release];
    
    self.likeButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.screenView addSubview:self.likeButton];
    
    self.likeCountLabel = [[UILabel alloc]init];
    [self.screenView addSubview:self.likeCountLabel];
    [self.likeCountLabel release];
    
    self.priceLabel = [[UILabel alloc]init];
    self.priceLabel.backgroundColor = [UIColor orangeColor];
    [self.picImageView addSubview:self.priceLabel];
    [self.priceLabel release];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.screenView.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    self.bottomView.frame = CGRectMake(0, HEIGHT - 90, WIDTH, 90);
    self.picImageView.frame = CGRectMake(0, 10, WIDTH, HEIGHT - 90);
    self.headImageView.frame = CGRectMake(10, HEIGHT - 70, 60, 60);
    self.titleLabel.frame = CGRectMake(80, HEIGHT - 70, 200, 30);
    self.introduceLabel.frame = CGRectMake(80, HEIGHT - 30, WIDTH - 130, 20);
    self.likeButton.frame = CGRectMake(WIDTH - 40, HEIGHT - 70, 30, 30);
    self.likeCountLabel.frame = CGRectMake(WIDTH - 40, HEIGHT - 30, 30, 20);
    self.priceLabel.frame = CGRectMake(WIDTH - 100, 10, 100, 30);
}
@end
